#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QPushButton>
#include <QLineEdit>
#include <QTcpSocket>
#include <QLabel>
#include <QDebug>
#include <QTimer>
#include <QEvent>
#include <QKeyEvent>
#include <QPixmap>
#include <QBitmap>
#include <QtCore>

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();


private slots:
    void on_link_clicked();

    void on_up_clicked();

    void on_yaogan_valueChanged(int value);

private:
    Ui::Widget *ui;
    QTcpSocket *tcpSocket;  //通信套接字
    QTcpSocket *catSocket;  //小车套接字
    QTimer *time;           //定时器
    QTimer *timeStop;       //停止定时器
    bool isIntIma=true;     //是大小还是文件
    int size=0;             //大小
    char img[1024*1024]={0};    //文件
    char buf_len[32] = {0};
    void keyPressEvent(QKeyEvent *e);

    void goUp();
    void goDown();
    void goLeft();
    void goRight();
    void goStop();


};
#endif // WIDGET_H
